import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建教室
export function createClassroomInfo(data) {
  return request({
    url: adminUrl + '/collegebase/classroom-info/create',
    method: 'post',
    data: data
  })
}

// 更新教室
export function updateClassroomInfo(data) {
  return request({
    url: adminUrl + '/collegebase/classroom-info/update',
    method: 'put',
    data: data
  })
}

// 删除教室
export function deleteClassroomInfo(id) {
  return request({
    url: adminUrl + '/collegebase/classroom-info/delete?id=' + id,
    method: 'delete'
  })
}

// 获得教室
export function getClassroomInfo(id) {
  return request({
    url: adminUrl + '/collegebase/classroom-info/get?id=' + id,
    method: 'get'
  })
}

// 获得教室分页
export function getClassroomInfoPage(query) {
  return request({
    url: adminUrl + '/collegebase/classroom-info/page',
    method: 'get',
    params: query
  })
}

// 导出教室 Excel
export function exportClassroomInfoExcel(query) {
  return request({
    url: adminUrl + '/collegebase/classroom-info/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
//获取教室分类
export function getClassroomCategory(name="") {
  return request({
    url: adminUrl + '/collegebase/classroom-category/byName/list',
    method: 'get',
    params: {
      name
    },
  })
}
